package com.gym.baselib.utils

import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch

fun runOnThread(threadMethod:()->Unit){
    MainScope().launch(Dispatchers.IO) {
        threadMethod()
    }
}

fun runOnMain(threadMethod:()->Unit){
    MainScope().launch(Dispatchers.Main) {
        threadMethod()
    }
}